class Solution(object):
    def slowestKey(self, releaseTimes, keysPressed):
        n = len(keysPressed)
        max_v = releaseTimes[0]
        max_c = keysPressed[0]
        for i in range(1, n):
            if releaseTimes[i] - releaseTimes[i - 1] > max_v:
                max_c = keysPressed[i]
                max_v = releaseTimes[i] - releaseTimes[i - 1]
            else:
                if releaseTimes[i] - releaseTimes[i - 1] == max_v:
                    max_c = max(max_c, keysPressed[i])
        return max_c




